package com.winning.util.excelutil.controller;

import com.winning.util.excelutil.common.controller.BaseController;
import com.winning.util.excelutil.common.dto.BaseProtocolOut;
import com.winning.util.excelutil.common.dto.MediaProtocolIn;
import com.winning.util.excelutil.service.ImportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**
 * @作者：caopengfei
 * @时间：2020/2/12
 */
@RestController
@RequestMapping("import")
public class ImportController extends BaseController {

    @Autowired
    private ImportService importService;

    @PostMapping("excel")
    public BaseProtocolOut importExcel(int updateIndex,MultipartFile file){

        importService.importExcel(updateIndex,file);
        return BaseProtocolOut.success("导入成功");
    }
}
